Fix a bug that leads to "ValueError: axes don't match array" in dataset_tool.py #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a patch to the Issue #110
Here's a fix for
dataset_tool.py
that fixesValueError: axes don't match array, images will work one run and not work the next
error.My debugging of the issue was as follows:
imagemagick
and tried to runmagick identify *.jpg
to search for greyscale images to purge from the dataset but the issue still persisted in my case.dataset_tool.py
to crash.I propose to use PIL to convert the image to RGB in any case. It should be able to work fine if the images are not
sRGB
, including the case when they are grayscale. It will most likely slows down the dataset preprocessing step a little bit (I haven't run any benchmarks). However, it is convenient if the training data is coming from varied sources, which I believe is the case for my users.